#!/usr/bin/env python
# -*- coding:utf-8 -*-

from flask_restful import Api

from . import ssouser_blueprint
from api_1_0.ssoUserResource.ssoUserResource import SsoUserResource
from api_1_0.ssoUserResource.ssoUserOtherResource import SsoUserOtherResource

api = Api(ssouser_blueprint)

api.add_resource(SsoUserResource, '/ssoUser/<user_id>', '/ssoUser', endpoint='SsoUser')


@ssouser_blueprint.route('/ssouser/update/<user_id>', methods=['PUT'], endpoint='SsoUserUpdate')
def update(user_id):
    return SsoUserOtherResource.sensitive_update(user_id)


@ssouser_blueprint.route('/sso-user-register', methods=['POST'], endpoint='SsoUserRegister')
def sso_user_login():
    return SsoUserOtherResource.sso_user_register()


@ssouser_blueprint.route('/sso-user-login', methods=['POST'], endpoint='SsoUserLogin')
def sso_user_login():
    return SsoUserOtherResource.sso_user_login()


@ssouser_blueprint.route('/sso-user-logout', methods=['POST'], endpoint='SsoUserLogout')
def sso_user_logout():
    return SsoUserOtherResource.sso_user_logout()


@ssouser_blueprint.route('/verify_email', methods=['POST'], endpoint='SsoUserVerifyEmail')
def verify_email():
    return SsoUserOtherResource.verify_email()


@ssouser_blueprint.route('/email-code-check', methods=['POST'], endpoint='SsoUserEmailCodeCheck')
def email_code_check():
    return SsoUserOtherResource.email_code_check()


@ssouser_blueprint.route('/change-password', methods=['PUT'], endpoint='SsoUserChangePassword')
def change_password():
    return SsoUserOtherResource.change_password()


@ssouser_blueprint.route('/password-forget-send', methods=['POST'], endpoint='SsoUserPasswordForgetSend')
def forget_password_send():
    return SsoUserOtherResource.forget_password_send()


@ssouser_blueprint.route('/password-forget-recover', methods=['POST'], endpoint='SsoUserPasswordForgetReset')
def forget_password_recover():
    return SsoUserOtherResource.forget_password_recover()


@ssouser_blueprint.route('/verify-token', methods=['POST'], endpoint='VerifyToken')
def verify_token():
    return SsoUserOtherResource.verify_token()
